<template>
		<div>
				{{ msg }}
				<p>{{ user }}</p>
		</div>
</template>

<script>
import request from '../network/request.js';
import {listAllDepts} from '../network/api'

export default {
		name: "VueAxios",
		data() {
				return {
						msg: 'Axios',
						user: {},
				}
		},
		methods: {},
		created() {
				//链式调用
				request({
						url: listAllDepts
				}).then(res => {

						const {data} = res;
						this.user = data.data
						console.log(this)
						return request({
								url: '/sys/dept/listAllDeptByQuery',
								method: 'get'
						})
				}).then(function (res) {
						console.log(this)
						console.log(res)
				})
		}
}
</script>

<style scoped>

</style>
